$(function(){
    $(".list a").click(function(){
        $(".list a").removeClass("active");
        $(this).addClass("active");
    })

    $(".slidelist").click(function(){
        $(".sublist").stop().slideToggle();
    })

    $(".glyphicon-log-out").click(function(){
        $(".fade").modal('toggle');
    })

    $(".glyphicon-align-justify").click(function(){
        $(".left, main").toggleClass("now");
    });

    $.ajax({
        url:"/employee/checkRootLogin",
        type:"GET",
        data: {},
        success: function(backdata){
            console.log(backdata);
            if(backdata.error){
                window.location.href="login.html"
            }
        }
    })

    $("#dologout").click(function(){
        $.ajax({
            url:"/employee/employeeLogout",
            type:"GET",
            data:{},
            success: function(backdata){
                console.log(backdata.success);
                window.location.href="login.html"
            }
        })
    })

    
    



})